/*****************************************************************************/
/*                                                                           */
/*    Domino Operation System Driver Module                                  */
/*    File System Routines                                                   */
/*                                                                           */
/*    Copyright (C) 2006-2014 Laszlo Arvai                                   */
/*                                                                           */
/*    ------------------------------------------------------------------   */
/*    Drives and Volumes handling routines                                   */
/*****************************************************************************/
#ifndef __fileVolumes_h
#define __fileVolumes_h

/*****************************************************************************/
/* Includes                                                                  */
/*****************************************************************************/
#include <krnlTypes.h>
#include <fileFAT.h>
#include "sysSettings.h"

/*****************************************************************************/
/* Constants                                                                 */
/*****************************************************************************/
#define fileINVALID_VOLUME_INDEX 0xff

/*****************************************************************************/
/* Types                                                                     */
/*****************************************************************************/
//typedef struct
//{
//}	fileDriveInfo;

typedef struct
{
	dosByte DriveIndex;
	dosByte FileSystemType;
	union
	{
		fatVolumeInfo FATVolumeInfo;
	};
} fileVolumeInfo;

#ifndef fileMULTI_DRIVE_SUPPORT
extern fileVolumeInfo g_file_volume_info;
#endif

/*****************************************************************************/
/* Volume access macros                                                      */
/*****************************************************************************/

#ifdef fileMULTI_DRIVE_SUPPORT
#define fileGET_CURRENT_VOLUME_INDEX() todo
#define fileREAD_VOLUME_SECTOR(x)
#define fileWRITE_VOLUME_SECTOR(x)
#else
#define fileGET_CURRENT_VOLUME_INDEX() (0)
#define fileGET_VOLUME_INFO_FROM_INDEX(index) (&g_file_volume_info)
#define fileREAD_VOLUME_SECTOR(volume,buffer,address) drvMSReadSector(buffer,address)
#define fileWRITE_VOLUME_SECTOR(volume,buffer,address) drvMSWriteSector(buffer,address)
#endif

///////////////////////////////////////////////////////////////////////////////
// Function prototypes
dosByte fileGetVolumeIndexFromDriveLetter(dosChar in_drive_letter);
dosBool fileReadSector( dosByte in_volume_index, dosByte* out_buffer, dosDWord in_lba );
dosBool fileWriteSector( dosByte in_volume_index, dosByte* in_buffer, dosDWord in_lba );



#endif